/**
 * FileName: OperationFactory
 *
 * @author: 阿张
 * Date:     2021/3/3 15:14
 */
package com.qx.factory;

import com.qx.service.Distribution;
import com.qx.service.OperationAdd;
import com.qx.service.OperationSubtract;

public class OperationFactory {

    //使用getDistribution来获取形状类型
    public Distribution getDistribution(String disType){
        if (disType == null){
            return null;
        }
        if ("add".equalsIgnoreCase(disType)){
            return new OperationAdd();
        } else if ("Subtract".equalsIgnoreCase(disType)){
            return new OperationSubtract();
        }
        return null;
    }
}
